<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1">
    <meta content=always name=referrer>
    <link rel="stylesheet" type="text/css" href="__STATIC__/css/style.css">
    <script src="__STATIC__/js/jquery-1.8.2.js"></script>
    <title>店铺信息</title>
    <style>
        .fileInput {
            width: 100%;
            height: 100%;
            position: absolute;
            opacity: 0;
            filter: alpha(opacity=0);
            cursor: pointer;
        }

        #wall {
            top: 30%;
            transform: scale(0.8);
            position: absolute;
            right: 3%;
            background: url(__STATIC__/img/next.png);
            width: 12px;
            height: 20px;
        }
    </style>
</head>
<body>
<form action="" id="form" method="post">
    <div class="wrap-shopinfo">
        <div class="header">
            <p>店铺信息</p>
            <img src="__STATIC__/img/back.png" class="back"
                 onclick=window.location.href="{:url('mobile/shop_auth/member_shop')}";>
        </div>
        <div class="dpset">
            <h4>店铺设置</h4>
            <ul>
                <li class="first">
                    <h4 class="left">店铺头像</h4>
                    <p class="right"><img src="{$domain}/{$info.logo}" class="pic1">
                        <!--<img src="__STATIC__/img/next.png" class="next" onclick="upload()">-->
                    <div id="wall">
                        <input type="file" id="File" name="file" class="fileInput"/>
                    </div>
                    </p>
                </li>
                <li>
                    <h4 class="left">店铺名称</h4>
                    <p class="right"><span>{$info.title}</span><img src="__STATIC__/img/next.png" class="next"
                                                                    onclick="window.location.href='edit_shop_name?title={$info.title}'">
                    </p>
                </li>
                <li>
                    <h4 class="left">认证身份</h4>
                    <p class="right"><span>{$info.type}</span></p>
                </li>
                <li>
                    <h4 class="left">店铺简介</h4>
                    <p class="right"><span style="line-height: 1.5;display: block">{$info.description}</span><a href="{:url('ShopAuth/edit_shop_description')}"><img
                            src="__STATIC__/img/next.png" class="next"></a></p>
                </li>
                <li>
                    <h4 class="left" id="address_1">发货地址</h4>
                    <p class="right"><input id="text_1"
                                            style="color: #989898;font-size: 14px;height: 30px;border:0;outline:none;"
                                            readonly type="text" value="{$info.ship_address}"/><a
                            href="{:url('ShopAuth/edit_shop_ship')}"><img
                            src="__STATIC__/img/next.png" class="next"></a></p>
                </li>
                <li class="last">
                    <h4 class="left" id="address_2">退货地址</h4>
                    <p class="right"><input id="text_2"
                                            style="color: #989898;font-size: 14px;height: 30px;border:0;outline:none;"
                                            readonly type="text" value="{$info.refund_address}"/><a
                            href="{:url('ShopAuth/edit_shop_refund')}"><img
                            src="__STATIC__/img/next.png" class="next"></a></p>
                </li>

            </ul>
        </div>
        <div class="zhset">
            <ul>
                <li>
                    <h4 class="left">账户设置</h4>
                </li>
                <li>
                    <h4 class="left">持卡人</h4>
                    <p class="right"><span>{$info.bank_name}</span><a href="{:url('ShopAuth/edit_shop_bank_name')}"><img
                            src="__STATIC__/img/next.png"
                            class="next"></a></p>
                </li>
                <li>
                    <h4 class="left">银行</h4>
                    <p class="right"><span>{$info.cardholder_name}</span><a
                            href="{:url('ShopAuth/edit_cardholder')}"><img src="__STATIC__/img/next.png"
                                                                           class="next"></a></p>
                </li>
                <li>
                    <h4 class="left">卡号</h4>
                    <p class="right"><span>{$info.cardholder_number}</span><a
                            href="{:url('ShopAuth/cardholder_number')}"><img src="__STATIC__/img/next.png"
                                                                             class="next"></a></p>
                </li>
            </ul>
        </div>
        <div class="footer">
            <ul>
                <li><a href="#">相册</a></li>
                <li><a href="#">拍照</a></li>
                <li class="cancel"><a href="#">取消</a></li>
            </ul>
        </div>
        <div class="board"></div>
    </div>
</form>
{include file="public/src" /}
<script>
    $(function () {
        var width = window.screen.width;
        var address1 = parseInt($('#address_1').css('width'));
        var address2 = parseInt($('#address_2').css('width'));
        var $this_1 = $('#text_1');
        var $this_2 = $('#text_2');
        var text_length_1 = $this_1.val().length;
        var text_length_2 = $this_2.val().length;
        var current_width_1 = parseInt(text_length_1) * 16;
        var current_width_2 = parseInt(text_length_2) * 16;
        if (0.7 * width - address1 < current_width_1) {
            $this_1.css("width", 0.7 * width - address1 + "px");
        } else {
            $this_1.css("width", current_width_1 + "px");
        }
        if (0.7 * width - address2 < current_width_2) {
            $this_2.css("width", 0.7 * width - address2 + "px");
        } else {
            $this_2.css("width", current_width_2 + "px");
        }
        //上传logo
        $('#File').change(function () {
            $('#form').ajaxSubmit({
                url: "{:url('mobile/shop_auth/upload_logo')}",
                type: 'post',
                dataType: 'json',
                enctype: 'multipart/form-data',
                success: function (t) {
                    if (t.code == 200) {
                        layer.open({content: 'logo上传成功', skin: 'msg', time: 2});
                        $('.pic1').prop('src', t.message);
                    } else {
                        layer.open({content: t.message, skin: 'msg', time: 2});
                    }
                }
            });
        })
    })

</script>
</body>
</html>